﻿#ifndef ADMIN_LOG_IN_H
#define ADMIN_LOG_IN_H

#include <QWidget>
#include <QSqlDatabase>
#include<QSqlQuery>
#include<QLabel>
#include<QTimer>
#include<QDateTime>
#include<QPushButton>
#include<QLineEdit>
#include<QTimer>
#include<opencv2/opencv.hpp>
#include"face.hpp"
#include<QMessageBox>
#include<vector>
#include<QPixmap>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include<vector>
using namespace cv;
QT_BEGIN_NAMESPACE
namespace Ui { class admin_log_in; }
QT_END_NAMESPACE

class admin_log_in : public QWidget
{
    Q_OBJECT

public:
    admin_log_in(QWidget *parent = nullptr);
    ~admin_log_in();

private slots:
    void face_recognition();
    void btclicked();
    void run_time();
    void on_pBOpen_clicked();


private:
    Ui::admin_log_in *ui;
    QTimer  timer_1;
    QTimer timer;
    QString password;
    void checkpassword(QString &password);
    VideoCapture capture;
    Mat gray,frame;
    CascadeClassifier cascade;
    Ptr<face::FaceRecognizer> model;
    int detection=0,num=0;
    int  Predict(Mat &image);
    QPixmap PixmapToRound(const QPixmap &src, int radius);
    std::vector<Rect>faces;

};
#endif // ADMIN_LOG_IN_H
